﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.LightSwitch;
namespace LightSwitchApplication
{
    public partial class SellOrderHeader
    {

        partial void Total_Compute(ref decimal result)
        {
            // Set result to the desired field value
            result = 0;
            foreach (SellOrder so in SellOrders)
            {
                result += so.SubTotal;
            }
        }

        partial void Amount_Compute(ref int result)
        {
            // Set result to the desired field value
            result = 0;
            foreach(SellOrder so in this.SellOrders)
                result += so.Quantity;
        }
    }
}
